import { useParams } from "react-router-dom";
import { useSearchParams } from "react-router-dom";
import { Link } from "react-router-dom";

function Login() {
  // 声明接收searchParams路由参数
  /* const [params] = useSearchParams();
  let id = params.get("id"); 
  let name = params.get("name"); */
  // 声明接收params路由参数
  const params = useParams();
  let id = params.id;
  let name = params.name;
  return (
    <>
      <div>
        Login组件 {id} {name}
      </div>
      {/* 声明式路由导航 */}
      <Link to="/article">跳转到文章页</Link>
    </>
  );
}

export default Login;
